package com.ty.day3.home;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/16 18:13
 */
public class User {
    private String username;
    private String password;
    static int count = 0;

    public User() {
        count++;
    }

    public User(String username) {
        this.username = username;
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String printInfo() {
        return "用户名：" + username + ", 密码：" + password;
    }
}
class Test1 {
    public static void main(String[] args) {
        User user = new User("王祖贤", "123");
        System.out.println(user.printInfo());
        User user1 = new User("txy");
        user1.setPassword("666");
        System.out.println(user1.printInfo());
    }
}
